home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / sndhrdw / mcr.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  15KB  |  649 lines

  1. /***************************************************************************
  2.  
  3.     sndhrdw/mcr.c
  4.  
  5.     Functions to emulate general the various MCR sound cards.
  6.  
  7. ***************************************************************************/
  8.  
  9. #include <stdio.h>
  10.  
  11. #include "driver.h"
  12. #include "machine/mcr.h"
  13. #include "sndhrdw/mcr.h"
  14. #include "sndhrdw/williams.h"
  15. #include "cpu/m6800/m6800.h"
  16. #include "cpu/m6809/m6809.h"
  17.  
  18.  
  19.  
  20. /*************************************
  21.  *
  22.  *    Global variables
  23.  *
  24.  *************************************/
  25.  
  26. UINT8 mcr_sound_config;
  27.  
  28.  
  29.  
  30. /*************************************
  31.  *
  32.  *    Statics
  33.  *
  34.  *************************************/
  35.  
  36. static UINT16 dacval;
  37.  
  38. /* SSIO-specific globals */
  39. static UINT8 ssio_sound_cpu;
  40. static UINT8 ssio_data[4];
  41. static UINT8 ssio_status;
  42. static UINT8 ssio_duty_cycle[2][3];
  43.  
  44. /* Chip Squeak Deluxe-specific globals */
  45. static UINT8 csdeluxe_sound_cpu;
  46. static UINT8 csdeluxe_dac_index;
  47. extern struct pia6821_interface csdeluxe_pia_intf;
  48.  
  49. /* Turbo Chip Squeak-specific globals */
  50. static UINT8 turbocs_sound_cpu;
  51. static UINT8 turbocs_dac_index;
  52. static UINT8 turbocs_status;
  53. extern struct pia6821_interface turbocs_pia_intf;
  54.  
  55. /* Sounds Good-specific globals */
  56. static UINT8 soundsgood_sound_cpu;
  57. static UINT8 soundsgood_dac_index;
  58. static UINT8 soundsgood_status;
  59. extern struct pia6821_interface soundsgood_pia_intf;
  60.  
  61. /* Squawk n' Talk-specific globals */
  62. static UINT8 squawkntalk_sound_cpu;
  63. static UINT8 squawkntalk_tms_command;
  64. static UINT8 squawkntalk_tms_strobes;
  65. extern struct pia6821_interface squawkntalk_pia0_intf;
  66. extern struct pia6821_interface squawkntalk_pia1_intf;
  67.  
  68.  
  69.  
  70. /*************************************
  71.  *
  72.  *    Generic MCR sound initialization
  73.  *
  74.  *************************************/
  75.  
  76. void mcr_sound_init(void)
  77. {
  78.     int sound_cpu = 1;
  79.     int dac_index = 0;
  80.  
  81.     /* SSIO */
  82.     if (mcr_sound_config & MCR_SSIO)
  83.     {
  84.         ssio_sound_cpu = sound_cpu++;
  85.         ssio_reset_w(1);
  86.         ssio_reset_w(0);
  87.     }
  88.  
  89.     /* Turbo Chip Squeak */
  90.     if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
  91.     {
  92.         pia_config(0, PIA_ALTERNATE_ORDERING, &turbocs_pia_intf);
  93.         turbocs_dac_index = dac_index++;
  94.         turbocs_sound_cpu = sound_cpu++;
  95.         turbocs_reset_w(1);
  96.         turbocs_reset_w(0);
  97.     }
  98.  
  99.     /* Chip Squeak Deluxe */
  100.     if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
  101.     {
  102.         pia_config(0, PIA_ALTERNATE_ORDERING | PIA_16BIT_AUTO, &csdeluxe_pia_intf);
  103.         csdeluxe_dac_index = dac_index++;
  104.         csdeluxe_sound_cpu = sound_cpu++;
  105.         csdeluxe_reset_w(1);
  106.         csdeluxe_reset_w(0);
  107.     }
  108.  
  109.     /* Sounds Good */
  110.     if (mcr_sound_config & MCR_SOUNDS_GOOD)
  111.     {
  112.         /* special case: Spy Hunter 2 has both Turbo CS and Sounds Good, so we use PIA slot 1 */
  113.         pia_config(1, PIA_ALTERNATE_ORDERING | PIA_16BIT_UPPER, &soundsgood_pia_intf);
  114.         soundsgood_dac_index = dac_index++;
  115.         soundsgood_sound_cpu = sound_cpu++;
  116.         soundsgood_reset_w(1);
  117.         soundsgood_reset_w(0);
  118.     }
  119.  
  120.     /* Squawk n Talk */
  121.     if (mcr_sound_config & MCR_SQUAWK_N_TALK)
  122.     {
  123.         pia_config(0, PIA_STANDARD_ORDERING | PIA_8BIT, &squawkntalk_pia0_intf);
  124.         pia_config(1, PIA_STANDARD_ORDERING | PIA_8BIT, &squawkntalk_pia1_intf);
  125.         squawkntalk_sound_cpu = sound_cpu++;
  126.         squawkntalk_reset_w(1);
  127.         squawkntalk_reset_w(0);
  128.     }
  129.  
  130.     /* Advanced Audio */
  131.     if (mcr_sound_config & MCR_WILLIAMS_SOUND)
  132.     {
  133.         williams_cvsd_init(sound_cpu++, 0);
  134.         dac_index++;
  135.         williams_cvsd_reset_w(1);
  136.         williams_cvsd_reset_w(0);
  137.     }
  138.  
  139.     /* reset any PIAs */
  140.     pia_reset();
  141. }
  142.  
  143.  
  144.  
  145. /*************************************
  146.  *
  147.  *    MCR SSIO communications
  148.  *
  149.  *    Z80, 2 AY-3812
  150.  *
  151.  *************************************/
  152.  
  153. /********* internal interfaces ***********/
  154. static WRITE_HANDLER( ssio_status_w )
  155. {
  156.     ssio_status = data;
  157. }
  158.  
  159. static READ_HANDLER( ssio_data_r )
  160. {
  161.     return ssio_data[offset];
  162. }
  163.  
  164. static void ssio_delayed_data_w(int param)
  165. {
  166.     ssio_data[param >> 8] = param & 0xff;
  167. }
  168.  
  169. static void ssio_update_volumes(void)
  170. {
  171.     int chip, chan;
  172.     for (chip = 0; chip < 2; chip++)
  173.         for (chan = 0; chan < 3; chan++)
  174.             AY8910_set_volume(chip, chan, (ssio_duty_cycle[chip][chan] ^ 15) * 100 / 15);
  175. }
  176.  
  177. static WRITE_HANDLER( ssio_porta0_w )
  178. {
  179.     ssio_duty_cycle[0][0] = data & 15;
  180.     ssio_duty_cycle[0][1] = data >> 4;
  181.     ssio_update_volumes();
  182. }
  183.  
  184. static WRITE_HANDLER( ssio_portb0_w )
  185. {
  186.     ssio_duty_cycle[0][2] = data & 15;
  187.     ssio_update_volumes();
  188. }
  189.  
  190. static WRITE_HANDLER( ssio_porta1_w )
  191. {
  192.     ssio_duty_cycle[1][0] = data & 15;
  193.     ssio_duty_cycle[1][1] = data >> 4;
  194.     ssio_update_volumes();
  195. }
  196.  
  197. static WRITE_HANDLER( ssio_portb1_w )
  198. {
  199.     ssio_duty_cycle[1][2] = data & 15;
  200.     mixer_sound_enable_global_w(!(data & 0x80));
  201.     ssio_update_volumes();
  202. }
  203.  
  204. /********* external interfaces ***********/
  205. WRITE_HANDLER( ssio_data_w )
  206. {
  207.     timer_set(TIME_NOW, (offset << 8) | (data & 0xff), ssio_delayed_data_w);
  208. }
  209.  
  210. READ_HANDLER( ssio_status_r )
  211. {
  212.     return ssio_status;
  213. }
  214.  
  215. void ssio_reset_w(int state)
  216. {
  217.     /* going high halts the CPU */
  218.     if (state)
  219.     {
  220.         int i;
  221.  
  222.         cpu_set_reset_line(ssio_sound_cpu, ASSERT_LINE);
  223.  
  224.         /* latches also get reset */
  225.         for (i = 0; i < 4; i++)
  226.             ssio_data[i] = 0;
  227.         ssio_status = 0;
  228.     }
  229.     /* going low resets and reactivates the CPU */
  230.     else
  231.         cpu_set_reset_line(ssio_sound_cpu, CLEAR_LINE);
  232. }
  233.  
  234.  
  235. /********* sound interfaces ***********/
  236. struct AY8910interface ssio_ay8910_interface =
  237. {
  238.     2,            /* 2 chips */
  239.     2000000,    /* 2 MHz ?? */
  240.     { MIXER(33,MIXER_PAN_LEFT), MIXER(33,MIXER_PAN_RIGHT) },    /* dotron clips with anything higher */
  241.     { 0 },
  242.     { 0 },
  243.     { ssio_porta0_w, ssio_porta1_w },
  244.     { ssio_portb0_w, ssio_portb1_w }
  245. };
  246.  
  247.  
  248. /********* memory interfaces ***********/
  249. struct MemoryReadAddress ssio_readmem[] =
  250. {
  251.     { 0x0000, 0x3fff, MRA_ROM },
  252.     { 0x8000, 0x83ff, MRA_RAM },
  253.     { 0x9000, 0x9003, ssio_data_r },
  254.     { 0xa001, 0xa001, AY8910_read_port_0_r },
  255.     { 0xb001, 0xb001, AY8910_read_port_1_r },
  256.     { 0xe000, 0xe000, MRA_NOP },
  257.     { 0xf000, 0xf000, input_port_5_r },
  258.     { -1 }    /* end of table */
  259. };
  260.  
  261. struct MemoryWriteAddress ssio_writemem[] =
  262. {
  263.     { 0x0000, 0x3fff, MWA_ROM },
  264.     { 0x8000, 0x83ff, MWA_RAM },
  265.     { 0xa000, 0xa000, AY8910_control_port_0_w },
  266.     { 0xa002, 0xa002, AY8910_write_port_0_w },
  267.     { 0xb000, 0xb000, AY8910_control_port_1_w },
  268.     { 0xb002, 0xb002, AY8910_write_port_1_w },
  269.     { 0xc000, 0xc000, ssio_status_w },
  270.     { 0xe000, 0xe000, MWA_NOP },
  271.     { -1 }    /* end of table */
  272. };
  273.  
  274.  
  275.  
  276. /*************************************
  277.  *
  278.  *    Chip Squeak Deluxe communications
  279.  *
  280.  *    MC68000, 1 PIA, 10-bit DAC
  281.  *
  282.  *************************************/
  283.  
  284. /********* internal interfaces ***********/
  285. static WRITE_HANDLER( csdeluxe_porta_w )
  286. {
  287.     dacval = (dacval & ~0x3fc) | (data << 2);
  288.     DAC_signed_data_16_w(csdeluxe_dac_index, dacval << 6);
  289. }
  290.  
  291. static WRITE_HANDLER( csdeluxe_portb_w )
  292. {
  293.     dacval = (dacval & ~0x003) | (data >> 6);
  294.     DAC_signed_data_16_w(csdeluxe_dac_index, dacval << 6);
  295. }
  296.  
  297. static void csdeluxe_irq(int state)
  298. {
  299.       cpu_set_irq_line(csdeluxe_sound_cpu, 4, state ? ASSERT_LINE : CLEAR_LINE);
  300. }
  301.  
  302. static void csdeluxe_delayed_data_w(int param)
  303. {
  304.     pia_0_portb_w(0, param & 0x0f);
  305.     pia_0_ca1_w(0, ~param & 0x10);
  306. }
  307.  
  308.  
  309. /********* external interfaces ***********/
  310. WRITE_HANDLER( csdeluxe_data_w )
  311. {
  312.     timer_set(TIME_NOW, data, csdeluxe_delayed_data_w);
  313. }
  314.  
  315. void csdeluxe_reset_w(int state)
  316. {
  317.     cpu_set_reset_line(csdeluxe_sound_cpu, state ? ASSERT_LINE : CLEAR_LINE);
  318. }
  319.  
  320.  
  321. /********* sound interfaces ***********/
  322. struct DACinterface mcr_dac_interface =
  323. {
  324.     1,
  325.     { 100 }
  326. };
  327.  
  328. struct DACinterface mcr_dual_dac_interface =
  329. {
  330.     2,
  331.     { 75, 75 }
  332. };
  333.  
  334.  
  335. /********* memory interfaces ***********/
  336. struct MemoryReadAddress csdeluxe_readmem[] =
  337. {
  338.     { 0x000000, 0x007fff, MRA_ROM },
  339.     { 0x018000, 0x018007, pia_0_r },
  340.     { 0x01c000, 0x01cfff, MRA_BANK1 },
  341.     { -1 }    /* end of table */
  342. };
  343.  
  344. struct MemoryWriteAddress csdeluxe_writemem[] =
  345. {
  346.     { 0x000000, 0x007fff, MWA_ROM },
  347.     { 0x018000, 0x018007, pia_0_w },
  348.     { 0x01c000, 0x01cfff, MWA_BANK1 },
  349.     { -1 }    /* end of table */
  350. };
  351.  
  352.  
  353. /********* PIA interfaces ***********/
  354. struct pia6821_interface csdeluxe_pia_intf =
  355. {
  356.     /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
  357.     /*outputs: A/B,CA/B2       */ csdeluxe_porta_w, csdeluxe_portb_w, 0, 0,
  358.     /*irqs   : A/B             */ csdeluxe_irq, csdeluxe_irq
  359. };
  360.  
  361.  
  362.  
  363. /*************************************
  364.  *
  365.  *    MCR Sounds Good communications
  366.  *
  367.  *    MC68000, 1 PIA, 10-bit DAC
  368.  *
  369.  *************************************/
  370.  
  371. /********* internal interfaces ***********/
  372. static WRITE_HANDLER( soundsgood_porta_w )
  373. {
  374.     dacval = (dacval & ~0x3fc) | (data << 2);
  375.     DAC_signed_data_16_w(soundsgood_dac_index, dacval << 6);
  376. }
  377.  
  378. static WRITE_HANDLER( soundsgood_portb_w )
  379. {
  380.     dacval = (dacval & ~0x003) | (data >> 6);
  381.     DAC_signed_data_16_w(soundsgood_dac_index, dacval << 6);
  382.     soundsgood_status = (data >> 4) & 3;
  383. }
  384.  
  385. static void soundsgood_irq(int state)
  386. {
  387.       cpu_set_irq_line(soundsgood_sound_cpu, 4, state ? ASSERT_LINE : CLEAR_LINE);
  388. }
  389.  
  390. static void soundsgood_delayed_data_w(int param)
  391. {
  392.     pia_1_portb_w(0, (param >> 1) & 0x0f);
  393.     pia_1_ca1_w(0, ~param & 0x01);
  394. }
  395.  
  396.  
  397. /********* external interfaces ***********/
  398. WRITE_HANDLER( soundsgood_data_w )
  399. {
  400.     timer_set(TIME_NOW, data, soundsgood_delayed_data_w);
  401. }
  402.  
  403. READ_HANDLER( soundsgood_status_r )
  404. {
  405.     return soundsgood_status;
  406. }
  407.  
  408. void soundsgood_reset_w(int state)
  409. {
  410.     cpu_set_reset_line(soundsgood_sound_cpu, state ? ASSERT_LINE : CLEAR_LINE);
  411. }
  412.  
  413.  
  414. /********* sound interfaces ***********/
  415. struct DACinterface turbocs_plus_soundsgood_dac_interface =
  416. {
  417.     2,
  418.     { 80, 80 }
  419. };
  420.  
  421.  
  422. /********* memory interfaces ***********/
  423. struct MemoryReadAddress soundsgood_readmem[] =
  424. {
  425.     { 0x000000, 0x03ffff, MRA_ROM },
  426.     { 0x060000, 0x060007, pia_1_r },
  427.     { 0x070000, 0x070fff, MRA_BANK1 },
  428.     { -1 }    /* end of table */
  429. };
  430.  
  431. struct MemoryWriteAddress soundsgood_writemem[] =
  432. {
  433.     { 0x000000, 0x03ffff, MWA_ROM },
  434.     { 0x060000, 0x060007, pia_1_w },
  435.     { 0x070000, 0x070fff, MWA_BANK1 },
  436.     { -1 }    /* end of table */
  437. };
  438.  
  439.  
  440. /********* PIA interfaces ***********/
  441. /* Note: we map this board to PIA #1. It is only used in Spy Hunter and Spy Hunter 2 */
  442. /* For Spy Hunter 2, we also have a Turbo Chip Squeak in PIA slot 0, so we don't want */
  443. /* to interfere */
  444. struct pia6821_interface soundsgood_pia_intf =
  445. {
  446.     /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
  447.     /*outputs: A/B,CA/B2       */ soundsgood_porta_w, soundsgood_portb_w, 0, 0,
  448.     /*irqs   : A/B             */ soundsgood_irq, soundsgood_irq
  449. };
  450.  
  451.  
  452.  
  453. /*************************************
  454.  *
  455.  *    MCR Turbo Chip Squeak communications
  456.  *
  457.  *    MC6809, 1 PIA, 8-bit DAC
  458.  *
  459.  *************************************/
  460.  
  461. /********* internal interfaces ***********/
  462. static WRITE_HANDLER( turbocs_porta_w )
  463. {
  464.     dacval = (dacval & ~0x3fc) | (data << 2);
  465.     DAC_signed_data_16_w(turbocs_dac_index, dacval << 6);
  466. }
  467.  
  468. static WRITE_HANDLER( turbocs_portb_w )
  469. {
  470.     dacval = (dacval & ~0x003) | (data >> 6);
  471.     DAC_signed_data_16_w(turbocs_dac_index, dacval << 6);
  472.     turbocs_status = (data >> 4) & 3;
  473. }
  474.  
  475. static void turbocs_irq(int state)
  476. {
  477.     cpu_set_irq_line(turbocs_sound_cpu, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
  478. }
  479.  
  480. static void turbocs_delayed_data_w(int param)
  481. {
  482.     pia_0_portb_w(0, (param >> 1) & 0x0f);
  483.     pia_0_ca1_w(0, ~param & 0x01);
  484. }
  485.  
  486.  
  487. /********* external interfaces ***********/
  488. WRITE_HANDLER( turbocs_data_w )
  489. {
  490.     timer_set(TIME_NOW, data, turbocs_delayed_data_w);
  491. }
  492.  
  493. READ_HANDLER( turbocs_status_r )
  494. {
  495.     return turbocs_status;
  496. }
  497.  
  498. void turbocs_reset_w(int state)
  499. {
  500.     cpu_set_reset_line(turbocs_sound_cpu, state ? ASSERT_LINE : CLEAR_LINE);
  501. }
  502.  
  503.  
  504. /********* memory interfaces ***********/
  505. struct MemoryReadAddress turbocs_readmem[] =
  506. {
  507.     { 0x0000, 0x07ff, MRA_RAM },
  508.     { 0x4000, 0x4003, pia_0_r },    /* Max RPM accesses the PIA here */
  509.     { 0x6000, 0x6003, pia_0_r },
  510.     { 0x8000, 0xffff, MRA_ROM },
  511.     { -1 }    /* end of table */
  512. };
  513.  
  514. struct MemoryWriteAddress turbocs_writemem[] =
  515. {
  516.     { 0x0000, 0x07ff, MWA_RAM },
  517.     { 0x4000, 0x4003, pia_0_w },    /* Max RPM accesses the PIA here */
  518.     { 0x6000, 0x6003, pia_0_w },
  519.     { 0x8000, 0xffff, MWA_ROM },
  520.     { -1 }    /* end of table */
  521. };
  522.  
  523.  
  524. /********* PIA interfaces ***********/
  525. struct pia6821_interface turbocs_pia_intf =
  526. {
  527.     /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
  528.     /*outputs: A/B,CA/B2       */ turbocs_porta_w, turbocs_portb_w, 0, 0,
  529.     /*irqs   : A/B             */ turbocs_irq, turbocs_irq
  530. };
  531.  
  532.  
  533.  
  534. /*************************************
  535.  *
  536.  *    MCR Squawk n Talk communications
  537.  *
  538.  *    MC6802, 2 PIAs, TMS5220, AY8912 (not used), 8-bit DAC (not used)
  539.  *
  540.  *************************************/
  541.  
  542. /********* internal interfaces ***********/
  543. static WRITE_HANDLER( squawkntalk_porta1_w )
  544. {
  545.     logerror("Write to AY-8912\n");
  546. }
  547.  
  548. static WRITE_HANDLER( squawkntalk_porta2_w )
  549. {
  550.     squawkntalk_tms_command = data;
  551. }
  552.  
  553. static WRITE_HANDLER( squawkntalk_portb2_w )
  554. {
  555.     /* bits 0-1 select read/write strobes on the TMS5220 */
  556.     data &= 0x03;
  557.  
  558.     /* write strobe -- pass the current command to the TMS5220 */
  559.     if (((data ^ squawkntalk_tms_strobes) & 0x02) && !(data & 0x02))
  560.     {
  561.         tms5220_data_w(offset, squawkntalk_tms_command);
  562.  
  563.         /* DoT expects the ready line to transition on a command/write here, so we oblige */
  564.         pia_1_ca2_w(0, 1);
  565.         pia_1_ca2_w(0, 0);
  566.     }
  567.  
  568.     /* read strobe -- read the current status from the TMS5220 */
  569.     else if (((data ^ squawkntalk_tms_strobes) & 0x01) && !(data & 0x01))
  570.     {
  571.         pia_1_porta_w(0, tms5220_status_r(offset));
  572.  
  573.         /* DoT expects the ready line to transition on a command/write here, so we oblige */
  574.         pia_1_ca2_w(0, 1);
  575.         pia_1_ca2_w(0, 0);
  576.     }
  577.  
  578.     /* remember the state */
  579.     squawkntalk_tms_strobes = data;
  580. }
  581.  
  582. static void squawkntalk_irq(int state)
  583. {
  584.     cpu_set_irq_line(squawkntalk_sound_cpu, M6808_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
  585. }
  586.  
  587. static void squawkntalk_delayed_data_w(int param)
  588. {
  589.     pia_0_porta_w(0, ~param & 0x0f);
  590.     pia_0_cb1_w(0, ~param & 0x10);
  591. }
  592.  
  593.  
  594. /********* external interfaces ***********/
  595. WRITE_HANDLER( squawkntalk_data_w )
  596. {
  597.     timer_set(TIME_NOW, data, squawkntalk_delayed_data_w);
  598. }
  599.  
  600. void squawkntalk_reset_w(int state)
  601. {
  602.     cpu_set_reset_line(squawkntalk_sound_cpu, state ? ASSERT_LINE : CLEAR_LINE);
  603. }
  604.  
  605.  
  606. /********* sound interfaces ***********/
  607. struct TMS5220interface squawkntalk_tms5220_interface =
  608. {
  609.     640000,
  610.     MIXER(60,MIXER_PAN_LEFT),
  611.     0
  612. };
  613.  
  614.  
  615. /********* memory interfaces ***********/
  616. struct MemoryReadAddress squawkntalk_readmem[] =
  617. {
  618.     { 0x0000, 0x007f, MRA_RAM },
  619.     { 0x0080, 0x0083, pia_0_r },
  620.     { 0x0090, 0x0093, pia_1_r },
  621.     { 0xd000, 0xffff, MRA_ROM },
  622.     { -1 }    /* end of table */
  623. };
  624.  
  625. struct MemoryWriteAddress squawkntalk_writemem[] =
  626. {
  627.     { 0x0000, 0x007f, MWA_RAM },
  628.     { 0x0080, 0x0083, pia_0_w },
  629.     { 0x0090, 0x0093, pia_1_w },
  630.     { 0xd000, 0xffff, MWA_ROM },
  631.     { -1 }    /* end of table */
  632. };
  633.  
  634.  
  635. /********* PIA interfaces ***********/
  636. struct pia6821_interface squawkntalk_pia0_intf =
  637. {
  638.     /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
  639.     /*outputs: A/B,CA/B2       */ squawkntalk_porta1_w, 0, 0, 0,
  640.     /*irqs   : A/B             */ squawkntalk_irq, squawkntalk_irq
  641. };
  642.  
  643. struct pia6821_interface squawkntalk_pia1_intf =
  644. {
  645.     /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
  646.     /*outputs: A/B,CA/B2       */ squawkntalk_porta2_w, squawkntalk_portb2_w, 0, 0,
  647.     /*irqs   : A/B             */ squawkntalk_irq, squawkntalk_irq
  648. };
  649.